<?php
/**
 * Created by JetBrains PhpStorm.
 * User: akrug
 * Date: 31.05.12
 * Time: 14:26
 * To change this template use File | Settings | File Templates.
 */

include_once('UcsMvc/AbstractForm.php');

class Form_User_Login extends UcsMvc_AbstractForm{
		
    public $elementDecorators = array('ViewHelper');

    public function init(){

        $email = new Zend_Form_Element_Text('username');
        $email->addValidator('NotEmpty', true)
              ->addValidator('EmailAddress', true)
              ->setRequired(true)
              ->setDecorators($this->elementDecorators)
        ->removeDecorator('error');

        $password = new Zend_Form_Element_Password('password');
        $password->setRequired(true)
                 ->addValidator('NotEmpty')
                 ->setDecorators($this->elementDecorators)
            ->removeDecorator('error');

        $login = new Zend_Form_Element_Submit('login');
        $login->setLabel($this->_translator->translate('OK', $this->_language))
        	  ->setAttrib ( 'class', 'fe_btnLogin' )
              ->setDecorators($this->elementDecorators)
              ->removeDecorator('Label');

        $this->addElements(array($email, $password, $login));
    }
}